<?php
//http://www.webdeveloper.com/forum/showthread.php?32227-Form-submit-from-popup-to-parent
/*
 * If you are using the GET method, you can just create the querystring yourself in the popup.

Code:

<script>

function doSubmit(f){
     qry="item1="+escape(f.field.value)+"&item2="+escape(f.field2.value);
              window.opener.document.location="yourpage.html?"+qry;
     self.close();
}
</script>


If you need to Post the data, create a form on the main window with a hidden field for each hidden field in the popup. Then, when you submit the form in the popup, populate those hidden fields through javascript and execute the POST.

Code:

<script>

function doSubmit(f){
     mainForm=window.opener.forms[0];
          mainForm.field.value=f.field.value;
     mainForm.field2.value=f.field2.value;
     mainForm.submit();
     self.close();
</script>



pupup 4
http://www.irt.org/script/338.htm
question: Q338 How can I submit a form
on a popup window and target the results into the main window and close the popup window at the same time?
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
myPopup = '';

function openPopup(url) {
    myPopup = window.open(url,'popupWindow','width=640,height=480');
    if (!myPopup.opener)
         myPopup.opener = self;
}
//--></SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Open Popup" onClick="openPopup('popupPage.html')">
</FORM>

<FORM NAME="hiddenForm" ACTION="nextPage.html">
<INPUT TYPE="HIDDEN" NAME="myTextField">
</FORM>

</BODY>
</HTML>

In the popupPage.html:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
function copyForm() {
    opener.document.hiddenForm.myTextField.value = document.popupForm.myTextField.value;
    opener.document.hiddenForm.submit();
    window.close();
    return false;
}
//--></SCRIPT>
</HEAD>
<BODY>
<FORM NAME="popupForm" onSubmit="return copyForm()">
<INPUT TYPE="TEXT" NAME="myTextField">
<INPUT TYPE="BUTTON" VALUE="Submit" onClick="copyForm()">
</FORM>
</BODY>
</HTML>

*/
?>